﻿using System;

namespace ConsoleApp3_Bank
{
    class BankStartApplication
    {
        static void Main(string[] args)
        {
            //创建银行账号和信用账号
            Account myAccount = new Account("test1", 1000);
            CreditAccount myCreditAccount = new CreditAccount("test1_credit", 500, 1000);

            ATM atm = new ATM();

            //设置当前账号
            atm.SetAccount(myAccount);

            //使用ATM
            atm.CheckBalance(); //查询余额
            atm.Deposit(200);  //存款
            atm.Withdraw(300); //取款

            //切换到信用账号
            atm.SetAccount(myCreditAccount);
            atm.CheckBalance(); //查询余额
            atm.Withdraw(1000); //取款（使用信用额度）
        }
    }
}
